package com.wwz.path;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.lang.Nullable;
import org.springframework.web.servlet.HandlerInterceptor;
import org.w3c.dom.Element;

/**
 * @author wwz
 */
public class PathRegisterBeanDefinition extends AbstractSingleBeanDefinitionParser {
    @Override
    protected Class<?> getBeanClass(Element element) {
        return PathMappingCreator.class;
    }
    @Override
    protected void doParse(Element element, BeanDefinitionBuilder bean) {
        String basePackage = element.getAttribute("basePackage");
        bean.addPropertyValue("basePackage", basePackage);
        PathMappingCreator.Creator.init(basePackage);


    }




}
